feat(cmp-firebase): commonMain-first Firebase (Analytics + Crashlytics, 15 targets) + crash→GA4 delivery audit fixes - #158
Merged
mobilebytesenseicommunity merged 6 commits intoAug 25, 2026
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…e.kts cmp-firebase/src/androidMain/kotlin/io/github/mobilebytelabs/kmptoolkit/firebase/FirebaseInitProvider.kt
…ase/build.gradle.kts cmp-firebase/src/commonMain/kotlin/io/github/mobilebytelabs/kmptoolkit/firebase/FirebaseKit.kt
….md cmp-firebase/src/commonMain/kotlin/io/github/mobilebytelabs/kmptoolkit/firebase/FirebaseConfig.kt
…bilebytelabs/kmptoolkit/firebase/analytics/InMemorySettings.kt cmp-firebase/src/commonMain/kotlin/io/github/mobilebytelabs/kmptoolkit/firebase/crashlytics/CrashReporterExtensions.kt cmp-firebase/src/commonMain/kotlin/io/github/mobilebytelabs/kmptoolkit/firebase/crashlytics/di/CrashReporterModule.kt
mobilebytesenseicommunity
marked this pull request as ready for review
August 25, 2026 19:06
mobilebytesenseicommunity
merged commit Aug 25, 2026
dda2380
into
MobileByteLabs:dev
8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delivers cmp-firebase as a commonMain-first Firebase library (unified Analytics + Crashlytics, one in-library setup surface across all 15 KMP targets) and then hardens the crash→GA4 delivery path via a full audit. The headline is a single, all-platform GA4 crash view: native Crashlytics on the 6 GitLive targets, and a Measurement-Protocol /
app_crashbridge everywhere else — so every platform lands in one GA4/BigQuery table segmentable bykmp_platform. Companioncmp-firebase-composestays a thin commonMain analytics layer.Changes
commonMain-first Firebase surface
FirebaseKit.initialize()/initialize(config)— one idempotent setup call;FirebaseConfig/FirebaseOptionsbuilder; Android auto-init viaFirebaseInitProvider;FirebaseRuntimeconfig holder.AnalyticsHelper+ GitLiveFirebaseAnalyticsHelper(firebaseMain tier) and a free Measurement-Protocol helper (nonFirebaseMain tier),kmp_platformauto-tagging, DI factory,NoOp/Stub/Testvariants.CrashReporter+FirebaseCrashReporter(native) /LoggingCrashReporter(fallback),CrashAnalyticsBridge→app_crashGA4 mirror.firebaseMain/nonFirebaseMain+crashlyticsFirebaseMain/crashlyticsFallbackMainflavor source sets.Audit fixes (crash→GA4 delivery)
MpRequestnow emitsclient_id/user_id/user_propertiesvia@SerialName— camelCase caused GA4 to 2xx-and-silently-drop every MP event (defeated the whole fallback + free-crash path). Locked byMpSerializationTest.provideAnalyticsHelper()memoizes one process-wide instance (reset oninitialize(config)) so the app's DI and the crash bridge share consent + MPclient_id(was a consent leak). Locked by a singleton test.FirebaseKit.installUncaughtHandler()— real on JVM/Android (chains existing handler →recordException(fatal=true)), safe no-op on native/js/wasm.app_crashMP events flush immediately instead of on the 5s debounce.asCoroutineExceptionHandler(fatal)+recording(fatal)overloads (the GA4fataldimension was always false).CrashReporterModule.Mode.Loggingnow passes an analytics sink.Platform.watchos.kt+ overstated 20/21→15 target counts — a dep, cmp-network-monitor, has no watchOS targets).API compatibility
BCV re-dumped as additive-only — the
fatalvariants and theLoggingCrashReporteranalytics sink are added as overloads / a secondary constructor, preserving every original signature (no binary-breaking removals).apiCheckgreen.Notable files
src/commonMain/.../FirebaseKit.kt,FirebaseConfig.kt,analytics/mp/MeasurementProtocolAnalyticsHelper.kt,crashlytics/CrashAnalyticsBridge.kt,crashlytics/LoggingCrashReporter.ktsrc/commonMain/.../UncaughtHandler.kt(+ jvm/android real, native/js/wasmJs no-op actuals)MpSerializationTest,AnalyticsTierRoutingTest,CrashAnalyticsBridgeTest,PlatformInjectionTest,FirebaseConfigTestVerified inline: jvm/js/wasmJs/macosArm64/android/linuxX64/metadata compile, jvmTest green, apiCheck green.
Documentation & secrets mapping
FirebaseKit.initialize(config)builder,installUncaughtHandler(),provideAnalyticsHelper()singleton,fatal-aware capture, crash→GA4 single view. Corrected all target counts to the real 15 (10 GitLive analytics + 5 MP fallback; 6 GitLive crash + 9 logging) and removed every phantom watchOS claim (cmp-network-monitor dep ships no watchOS artifact) — including residual library-source KDocs.mbs-firebase-sa+mbs-ga4-property-id; project-level per app =google-services.json/ plist / app-ids /ga4-measurement-id/mp-api-secret. Added an org-vs-project → vault-alias mapping table + the automaticsecrets-resolve-path.sh --emit tierresolution rule. Fixed a property-id-vs-measurement-id conflation.<proj>-mp-api-secret. The org SA + property id are read-side (growth dashboard), never consumed by the library.